{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import random\n",
    "\n",
    "m = 10\n",
    "n = 40\n",
    "\n",
    "w = []\n",
    "p = []\n",
    "c = []\n",
    "\n",
    "for i in range(m * n):\n",
    "    w.append(random.randint(1, 100))\n",
    "    p.append(100 - w[i] + random.randint(1, 21))\n",
    "w = np.array(w).reshape(m, n)\n",
    "p = np.array(p).reshape(m, n)\n",
    "\n",
    "for i in range(m):\n",
    "    sum = 0\n",
    "    for j in range(n):\n",
    "        sum += w[i][j]\n",
    "    sum /= m\n",
    "    c.append(sum * 0.8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sum = '{'\n",
    "for row in range(w.shape[0]):\n",
    "    sum += '{'\n",
    "    sum += ', '.join([ str(i) for i in p[row]])\n",
    "    sum += '},'\n",
    "sum = sum[:-1] + '};'\n",
    "print(sum)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sum = '{'\n",
    "for row in range(w.shape[0]):\n",
    "    sum += '{'\n",
    "    sum += ', '.join([ str(i) for i in w[row]])\n",
    "    sum += '},'\n",
    "sum = sum[:-1] + '};'\n",
    "print(sum)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "'{' + str([round(i, 2) for i in c])[1:-1] + '};'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "07efdcd4b820c98a756949507a4d29d7862823915ec7477944641bea022f4f62"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8 64-bit ('base': conda)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
